<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>

<!DOCTYPE html>
<html>
<head>
	<title>未处理调价计划</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
    <style type="text/css">
    .box-body{
    margin-top:-10px;
    }    	
    </style>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
	<section class="content-header">
        <h1>未处理调价计划</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
			<li class="active"><a href="#">交易</a></li>
			<li class="active"><a href="#">药品调价</a></li>
            <li class="active"><a href="#">未处理调价计划</a></li>
        </ol>
    </section>
    
	<section class="content">
	   <form id="form" method="post" class="form-horizontal">
		<div class=" box box-success">
			<div class="box-body">
			   <div class="input">
			        <div class="textalign1">计划名称：</div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="priceAdjPlanName" placeholder="计划名称" />
                    </div>
                    <div class="textalign">执行方式：</div>
                    <div class="boxinput">
                        <select class="textinput" id="executeCat">
							<option value="">请选择</option>
                       		<option value="1">手动执行</option>
                       		<option value="2">自动执行</option>
                       	</select>
                    </div>
                    <div class="textalign" >制定时间：</div>
                    <div class="boxinput"> 
                        <table style="width:100%;">
                                <tr>
                                    <td style="width:50%">       
                                        <input class="textinput" id='createStartTime' type="text"  placeholder="yyyy-MM-dd" onFocus="var endDate=$dp.$('createEndTime');WdatePicker({maxDate:'#F{$dp.$D(\'createEndTime\')}'})" >
						            </td>
                                    <td>&nbsp;-&nbsp;</td>
                                    <td style="width:50%">       
                                        <input class="textinput" id='createEndTime' type="text"  placeholder="yyyy-MM-dd" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'createStartTime\')}'})"  >
                                    </td>
                                </tr>
                         </table>        
                    </div>			   
			   </div>
			   <div class="input"  style="margin-top:-5px">
			        <div class="textalign1" >执行时间：</div>
                    <div class="boxinput"> 
                        <table style="width:100%;">
                                <tr>
                                    <td style="width:50%">       
                                        <input class="textinput" id='executeStartTime' type="text"  placeholder="yyyy-MM-dd" onFocus="var endDate=$dp.$('executeEndTime');WdatePicker({maxDate:'#F{$dp.$D(\'executeEndTime\')}'})"  >
                        
						            </td>
                                    <td>&nbsp;-&nbsp;</td>
                                    <td style="width:50%">       
                                        <input class="textinput" id='executeEndTime' type="text"  placeholder="yyyy-MM-dd"  onFocus="WdatePicker({minDate:'#F{$dp.$D(\'executeStartTime\')}'})"  >
                       
                                    </td>
                                </tr>
                         </table>        
                    </div>	
                    <div class="textalign" >
                       <button type="button" class="btn btn-success btn-sm" onclick="gridReload()" id="selectPlan">查&nbsp;询</button>
                    </div>
			   </div>
			
			</div>
		 </div>
		</form>
		<table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
	
	</section>

	<%@ include file="/WEB-INF/component/commonJS.jsp" %>
	
	<script type="text/javascript">
	
		//绑定回车
	    $('#priceAdjPlanName,#executeCat,#createStartTime,#createEndTime,#executeStartTime,#executeEndTime').bind('keydown', function(event) {
	        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
	            $('#selectPlan').click();
	        }
	    }); 
  		
	    $("#priceAdjPlanName").focus();//加载页面光标在第一个查询框内
	    
		function gridReload(page){
			var priceAdjPlanName = $.trim($("#priceAdjPlanName").val());
			var executeCat = $("#executeCat").val();
			var createStartTime = $("#createStartTime").val();
			var createEndTime = $("#createEndTime").val();
			var executeStartTime = $("#executeStartTime").val();
			var executeEndTime = $("#executeEndTime").val();
			
			jQuery("#gridlist").jqGrid('setGridParam',{  
				mtype: "POST",
		        datatype:'json',
		        postData:{"priceAdjPlanName":priceAdjPlanName,"executeCat":executeCat,"createStartTime":createStartTime,
				          "createEndTime":createEndTime,"executeStartTime":executeStartTime,"executeEndTime":executeEndTime},
		        page : (page || 1)
		    }).trigger("reloadGrid"); //重新载入  
		}
		
		$(function () {
			jQuery("#gridlist").jqGrid({
				url: "${ctx}/wsjPriceAdjust/getNoPriceAdjPlanList.html",
			    mtype: "post",
				datatype: "json",
				autowidth: true,
			//	height: 270,
			   	colNames:['操作','计划名称','执行方式','制定时间','执行时间','调价依据'],
			   	colModel:[
                    {name:'opts', width:60, align:"center", sortable:false, formatter :function(val, opts, rowdata){
		                 var opts = "<a href='${ctx}/wsjPriceAdjust/toEditPriceAdjPlan.html?id=" + rowdata.priceAdjPlanId + "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat 0px 0px' class='opIcon' title='编辑'></a>";
		                 opts += "<a href='${ctx}/wsjPriceAdjust/toPriceAdjPlanDetail.html?id=" + rowdata.priceAdjPlanId + "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='调价明细'></a>";
		                 return opts;
	                }},
			   		{name:'priceAdjPlanName', width:180, align:"left", sortable:false},
			   		{name:'executeCat', width:120, align:"center", sortable:false},
					{name:'createDatetime', width:120, align:"center", sortable:false },
			   		{name:'executeDatetime', width:180, align:"center", sortable:false},
			   		{name:'priceAdjAccord', width:180, align:"left", sortable:false }
			   		
			   	],
				 rowNum: 20,
				 rowList: [10, 20, 50, 100],
			     rownumbers: true,
			     pager: "#gridpage",
			     viewrecords: true,
			     caption: "未处理调价计划",
			     editurl:"priceChangeList.jsp",
			     jsonReader: {
			         id: "priceAdjPlanId"
			     },
			     gridComplete:function(){
	                    //序号列宽度自适应（参数为jqgridID）
	                    autoRNWidth("gridlist");
	                    //数据只有一条时默认选中（参数为jqgridID）
	                    selectByOneData("gridlist");
	                }
			});
				 
			$("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
			$(window).trigger("resize");        
			$("#gridlist").jqGrid("setGridHeight",create());
		});
	
		
	</script>
</body>
</html>